<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.lable.drugqualityspecSeeStd"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
                            
    <section class="content-header">
        <h1><spring:message code="message.lable.drugqualityspecSTDsee"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.drugqualityspecStd"/></a></li>
        </ol>
    </section>
        
    <section class="content">
    
        <div class=" box box-success">
            <div class="box-body">
             <form action="${ctx}/stdDrugQualitySpec/exportExcel.html" id="exportExcel" method="post">
             <input id="fileName" name="fileName" type="hidden" value="<spring:message code="message.lable.drugqualityxls"/>" />
                <div class="input">
                	<div class="textalign1"><spring:message code="message.listForm.pinGuiMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugQualitySpecName" name="qualityspecName" placeholder="<spring:message code="message.listForm.pinGuiMingCheng"/>" maxlength="200"  />
                    </div>
                    <div class="textalign"><spring:message code="message.listForm.pinGuiBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugQualitySpecCode" name="qualityspecCode" placeholder="<spring:message code="message.listForm.pinGuiBianMa"/>" maxlength="100" />
                    </div>
                    
                    <div class="textalign"><spring:message code="message.listForm.jiXing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="formname" name="formName" placeholder="<spring:message code="message.listForm.jiXing"/>" maxlength="200" />
                    </div>
                </div>
              
                <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.guiGe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="specname" name="specName" placeholder="<spring:message code="message.listForm.guiGe"/>" maxlength="200" />
                    </div>
                    <div class="textalign"><spring:message code="message.lable.status"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <select class="textinput"  id="status" name="status">
                            <option value=""><spring:message code="message.select.option"/></option>
                            <option value="1"><spring:message code="message.button.start"/></option>
                            <option value="2"><spring:message code="message.button.stop"/></option>
                        </select>
                    </div>
                    <div class="textalign" >
                         <button id="selectSpec" type="button" onclick="gridSerch();" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </form>
            </div>
          </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
             <ms:btn url="/stdDrugQualitySpec/add.html"><a class="btn btn-default btn-sm" onclick="addDrugQualitySpec()"><spring:message code="message.button.addSpacing"/></a></ms:btn>
             <ms:btn url="/stdDrugQualitySpec/enable.html"><label class="btn btn-default btn-sm" onclick="batchChangeStatus(1)"><spring:message code="message.button.startSpacing"/></label></ms:btn>
             <ms:btn url="/stdDrugQualitySpec/disable.html"><label class="btn btn-default btn-sm" onclick="batchChangeStatus(2)"><spring:message code="message.button.stopSpacing"/></label></ms:btn>
             <label onclick="exportExcel();" class="btn btn-default btn-sm"><spring:message code="message.lable.daoChu"/></label>
        </div>
        <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header bg-primary">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h5 class="modal-title" id="exampleModalLabel"><spring:message code="message.lable.drugqualityspecSTDadd"/></h5>
                    </div>
                    <div class="modal-body">
                  <form id="formSubmit"  action="saveOrEditDrugQualitySpec.html">
                   
                    <div class="form-group form-group-xs" style="width:100%;float:left;padding-left:10px;">
                        <label for="recipient-name" class=" control-label"><span style="color:red">* </span><spring:message code="message.listForm.pinGuiMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input type="text" class="form-control" id="qualitySpecName" name="qualitySpecName" placeholder="<spring:message code="message.listForm.pinGuiMingCheng"/>" maxlength="256">
                    </div>
                     <div class="form-group form-group-xs" style="width:100%;float:left;padding-left:10px;">
                        <label for="recipient-name" class=" control-label"><spring:message code="message.listForm.pinGuiMingChengEnglish"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input type="text" class="form-control" id="qualitySpecNameEng" name="qualitySpecNameEng" placeholder="<spring:message code="message.listForm.pinGuiMingChengEnglish"/>" maxlength="512">
                    </div>
                    
                   
                    <div class="form-group form-group-xs" style="width:100%;float:left;padding-left:10px;">
                        <label for="recipient-name" class=" control-label"><span style="color:red">* </span><spring:message code="message.listForm.JiXingMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input onclick="dicForm();" class="form-control" readonly="readonly" id="formName" name="formName" placeholder="<spring:message code="message.listForm.JiXingMingCheng"/>"  type="text" />
                    </div>
                    <div class="form-group form-group-xs" style="width:100%;float:left;padding-left:10px;">
                        <label for="recipient-name" class=" control-label"><span style="color:red">* </span><spring:message code="message.listForm.GuiGeMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input onclick="dicSpec();" class="form-control" readonly="readonly" id="specName" name="specName" placeholder="<spring:message code="message.listForm.GuiGeMingCheng"/>"  type="text" />
                    </div>
                    <input type="hidden" id="qualitySpecId"> 
                    <input type="hidden" id="qualitySpecStatus"> 
                </form>
                    </div>
              <div class="modal-footer">
              <input hidden="true" id="spid"/>
              <input hidden="true" id="spfatherid"/>
                  <button type="button" onclick="save();" class="btn btn-primary btn-sm"><spring:message code="message.button.saveSpacing"/></button>
                  <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal"><spring:message code="message.button.closeSpacing"/></button>
              </div>
            </div>
         </div>
      </div>
    </section>
    
      <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    
    <script type="text/javascript">
    
  //绑定回车
    $('#drugQualitySpecCode,#drugQualitySpecName,#formname,#specname,#status').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectSpec').click();
        }
    }); 
  
    $("#drugQualitySpecName").focus();//加载页面光标在第一个查询框内
    
        function addDrugQualitySpec(){
        	$('#exampleModalLabel').html("<spring:message code="message.lable.drugqualityspecSTDadd"/>"); 
            $("#qualitySpecCode").val("");
            $("#qualitySpecName").val("");
            $("#qualitySpecNameEng").val("");
            $("#formName").val("");
            $("#specName").val("");
            $("#qualitySpecId").val("");
            $("#qualitySpecStatus").val("");
            $("#historyQualitySpecCode").val("");
            $('#exampleModal').modal({
                keyboard: true
            });
        }
        function edit(drugQualitySpecId,drugQualitySpecCode){
             $('#exampleModalLabel').html("<spring:message code="message.lable.drugqualityspecSTDedit"/>&nbsp;"+drugQualitySpecCode); 
            $.post("${ctx}/stdDrugQualitySpec/getStdDrugQualitySpecForEdit.html", {
                drugQualitySpecId : drugQualitySpecId
            },      
            function(result) {
                if (result.success) {
                    var stdDrugQualitySpec = result.rows;       
                        $("#qualitySpecCode").val(stdDrugQualitySpec.qualitySpecCode);
                        $("#qualitySpecName").val(stdDrugQualitySpec.qualitySpecName);
                        $("#qualitySpecNameEng").val(stdDrugQualitySpec.qualitySpecNameEng);
                        $("#formName").val(stdDrugQualitySpec.formName);
                        $("#specName").val(stdDrugQualitySpec.specName);
                        $("#qualitySpecId").val(stdDrugQualitySpec.qualitySpecId);
                        $("#qualitySpecStatus").val(stdDrugQualitySpec.status);
                        $("#historyQualitySpecCode").val(stdDrugQualitySpec.historyQualitySpecCode);
                        $('#exampleModal').modal({
                            keyboard: true
                        });
                }else{
                    $("#qualitySpec").val("");
                    $("#qualitySpec").val("");
                    $("#qualitySpecNameEng").val("");
                    $("#formName").val("");
                    $("#specName").val("");
                    $.alert('<spring:message code="message.HN.alert.fail"/><spring:message code="message.yanZheng.ganTanHao"/>', 'error');
                }
                
            }, "json");
            
            
        }
        function save(){
            if (!validate()) {
                return;
            }
            var qualitySpecCode = $.trim($('#qualitySpecCode').val());
            var qualitySpecName = $.trim($('#qualitySpecName').val());
            var qualitySpecNameEng = $.trim($('#qualitySpecNameEng').val());
            var qualitySpecId = $.trim($('#qualitySpecId').val());
            var qualitySpecStatus = $.trim($("#qualitySpecStatus").val());
            var formName = $.trim($('#formName').val());
            var form = $.trim($('#form').val());
            var formCode = $.trim($('#formCode').val());
            var specName = $.trim($('#specName').val());
            var spec = $.trim($('#spec').val());
            var specCode = $.trim($('#specCode').val());
            var historyQualitySpecCode = $("#historyQualitySpecCode").val();
            $.HN.message.confirm('<spring:message code="message.HN.alert.OkSaveYESorNO"/>', '', '').on(function (e) {
                   if (e) {
                       if (e) {
                    	   var url = "${ctx}/stdDrugQualitySpec/add.html";
                           if(qualitySpecId !=null && qualitySpecId != ""){  
                        	   url = "${ctx}/stdDrugQualitySpec/edit.html";  
                        	   }
                        $.ajax({
                           type: "POST",
                           url: url,
                          
                           data:{
                                qualitySpecCode:qualitySpecCode,
                                qualitySpecName:qualitySpecName,
                                qualitySpecNameEng:qualitySpecNameEng,
                                qualitySpecId:qualitySpecId,
                                historyQualitySpecCode:historyQualitySpecCode,
                                formName:formName,
                                specName:specName,
                                form:form,
                                formCode:formCode,
                                spec:spec,
                                specCode:specCode
                           },
                           dataType:"json",
                           success: function(result){
                               if(result.success){
                            	   if(qualitySpecId !=null && qualitySpecId != ""){
                            		   $.alert("<spring:message code='message.HN.alert.baoCunCheng'/>", "success");
                                   }else{
                                	   $.alert("为您新增一条编码为"+result.msg+"的品规", "success");
                                   }
                                   $("#gridlist").jqGrid('setGridParam',{page:1}).trigger("reloadGrid");
                                   $('#exampleModal').modal('hide');
                               }else{
                                   $.alert("<spring:message code='message.HN.alert.baoCunBai'/>", 'error');
                                       }
                                   }
                            });
                        }
             }
           });
        }
        
        function validate(){
                var qualitySpecCode = $.trim($('#qualitySpecCode').val());
                var qualitySpecName = $.trim($('#qualitySpecName').val());
                var qualitySpecNameEng = $.trim($('#qualitySpecNameEng').val());
                var form = $.trim($('#formName').val());
                var spec = $.trim($('#specName').val());
                
                
           if(qualitySpecName==null || qualitySpecName == ""){
                $.alert('<spring:message code="message.yanZheng.qingShuRu"/><spring:message code="message.listForm.pinGuiMingCheng"/><spring:message code="message.yanZheng.ganTanHao"/>',  'warn');
                return false;
           }else if (qualitySpecName.length>170){
               $.alert("<spring:message code="message.listForm.pinGuiMingCheng"/><spring:message code="message.info.zuiDaChangDu"/>170<spring:message code="message.info.geZiFu"/><spring:message code="message.yanZheng.ganTanHao"/>",  "warn");
               return  false;
           }
           
           if (qualitySpecNameEng != null && qualitySpecNameEng != "" && /[^\u0000-\u007F]+/.test(qualitySpecNameEng)) {
               $.alert("<spring:message code="message.listForm.pinGuiMingChengEnglish"/><spring:message code="message.yanZheng.zhiNengYouZiMuShuZiZuCheng"/>",  "warn");
               return false;
           }else if (qualitySpecNameEng.length>512){
               $.alert("<spring:message code="message.listForm.pinGuiMingChengEnglish"/><spring:message code="message.info.zuiDaChangDu"/>512<spring:message code="message.info.geZiFu"/><spring:message code="message.yanZheng.ganTanHao"/>",  "warn");
               return  false;
           }
           
         
           if(form==null || form == ""){
                $.alert('<spring:message code="message.listForm.dianJiXuanZe"/><spring:message code="message.listForm.JiXingMingCheng"/><spring:message code="message.yanZheng.ganTanHao"/>',  'warn');//剂型名称不为空
                return false;
           }
           if(spec==null || spec == ""){
               $.alert('<spring:message code="message.listForm.dianJiXuanZe"/><spring:message code="message.listForm.GuiGeMingCheng"/><spring:message code="message.yanZheng.ganTanHao"/>',  'warn');//规格名称不为空
               return false;
          }
           
   
           
           return true;
       }

         function back(){
            window.location.href="toDrugQualitySpecList.html";
         }
         //启用、停用
         function batchChangeStatus(status) {
        	 var msg = "";
        	 var url = ""; 
         	if (status == 1){
         		msg = "<spring:message code="message.button.start"/>";
         		 url = "${ctx}/stdDrugQualitySpec/disable.html";
         	} else if (status == 2){
         		msg = "<spring:message code="message.button.stop"/>";
         		url = "${ctx}/stdDrugQualitySpec/enable.html";
         	}
 			var rowIds = $("#gridlist").jqGrid("getGridParam", "selarrrow") || [];
 			if (rowIds.length <= 0) {
 				$.alert("<spring:message code="message.lable.pleaseSelect"/>"+msg+"<spring:message code="message.lable.userpingui"/><spring:message code="message.yanZheng.ganTanHao"/>", "warn");
 				return;
 			}
 			var str = "";
         	var names = "";
         	var count = 0;
         		for (var i = 0;i < rowIds.length; i++){
         			var rowdata = $("#gridlist").jqGrid('getRowData', rowIds[i]);
             		if (status == 1){
             			if (rowdata.status == "<spring:message code="message.button.stop"/>"){
             				names += rowdata.qualitySpecName+",";
             				str += rowIds[i]+",";
             				count++;
             			}
             		} else {
             			if (rowdata.status == "<spring:message code="message.button.start"/>"){
             				names += rowdata.qualitySpecName+",";
             				str += rowIds[i]+",";
             				count++;
             			}
             		}
             	}
         		if (names != ""){
         			names = names.substring(0,names.length-1);
         		} else {
         			$.alert("<spring:message code="message.lable.ninXuanZe"/><spring:message code="message.lable.userpingui"/><spring:message code="message.lable.yiJingShi"/>"+msg+"<spring:message code="message.lable.zhuangTaiGTH"/>", "warn");
             		return;
         		}
         		
         		//获取选中的ID及对应的名字（参数:jqgridId,名字列名，状态列名，当前操作即列表中显示的值），返回infos[0]是ID串，infos[1]是名字串
                var infos = batchSwitchStatus("gridlist","qualitySpecName","status",msg,"<spring:message code='message.lable.userpingui'/>");
                if ( !(infos instanceof Array)){
                    return;
                }
         		
         		  $.HN.message.confirm('<spring:message code="message.lable.OKYES"/>'+msg+'<spring:message code="message.lable.yiXia"/><spring:message code="message.lable.userpingui"/><spring:message code="message.lable.ma"/><br/>'+infos[1].replace(/\,/g,"<br/>"), '', '').on(function (e) {
 	            if (e) {
 	            	if (str.length > 0){
                 		str = str.substring(0,str.length-1);
                 	}
 	            	var list = [];
		    		for (var i=0; i<rowIds.length; i++) {
		    			rowId = rowIds[i];
		    			list.push({"qualitySpecId":rowId,"status":status});
		    		}
                     $.post(url, {
                    	 "array" : json.jsonToString(list)
                     }, function(result) {
                         if (result.success) {
                             var curpage = $("#gridlist").jqGrid('getGridParam', 'page');
                             gridSerch(curpage);
                             $.alert("<spring:message code="message.HN.alert.chengGong"/>"+msg+count+"<spring:message code="message.lable.tiao"/><spring:message code="message.lable.userpingui"/><spring:message code="message.yanZheng.ganTanHao"/>", "success");
                         } else {
                             $.alert(msg+"<spring:message code="message.HN.alert.shibai"/><spring:message code="message.yanZheng.ganTanHao"/>", "error");
                         }
                     }, "json")
                 }
              });
         }
        
        function gridSerch(page) {
            var drugQualitySpecCode = $.trim($("#drugQualitySpecCode").val());
            var drugQualitySpecName = $.trim($("#drugQualitySpecName").val());
            var formName = $.trim($("#formname").val());
            var specName = $.trim($("#specname").val());
            var status = $.trim($("#status").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"drugQualitySpecCode":drugQualitySpecCode, "drugQualitySpecName":drugQualitySpecName, "formName":formName, "specName": specName,"status":status},
                page : (page || 1)
            }).trigger("reloadGrid"); //重新载入  
        }
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "getDrugQualitySpecList.html",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                height: 270,
                colNames: [
                    '<spring:message code="message.jqGrid.cz"/>',//操作
                    '<spring:message code="message.listForm.pinGuiID"/>',
                    '<spring:message code="message.listForm.pinGuiBianMa"/>', 
                    '<spring:message code="message.listForm.pinGuiMingCheng"/>', 
                    '<spring:message code="message.listForm.JiXingMingCheng"/>', 
                    '<spring:message code="message.listForm.GuiGeMingCheng"/>',  
                    '<spring:message code="message.lable.status"/>'
                    
                ],
                colModel: [
                    { name: 'operate', width: 60, align:"center", sortable: false,
                        formatter : function(val, opts, rowdata) {
                            var str =  "<ms:btn url='/stdDrugQualitySpec/edit.html'><a href=\"javascript:edit('"+rowdata.qualitySpecId+"','"+rowdata.qualitySpecCode+"');\" style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat 0px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.bianJi"/>'></a></ms:btn>";//编辑
                            str += "<ms:btn url='/stdDrugQualitySpec/toDrugQualitySpecDetail.html'><a href='toDrugQualitySpecDetail.html?opType=1&drugQualitySpecId=" + rowdata.qualitySpecId + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a></ms:btn>";//详情
                            str += "<ms:btn url='/stdDrugQualitySpec/toDrugQualitySpecLogList.html'><a href='toDrugQualitySpecLogList.html?qualitySpecId=" + rowdata.qualitySpecId + "&qualitySpecCode="+rowdata.qualitySpecCode+"&qualitySpecName="+rowdata.qualitySpecName+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -120px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.weiHuJiLu"/>'></a></ms:btn>";//维护记录
                            return str;
                            }
                    },
                    { name: 'qualitySpecId',hidden:true, width: 100, align:"center", sortable: false},
                    { name: 'qualitySpecCode', width: 80, align:"center", sortable: false },
                    { name: 'qualitySpecName', width: 100, align:"left", sortable: false},
                    { name: 'formName', width: 100, align:"center", sortable: false},
                    { name: 'specName', width: 110, align:"center", sortable: false},
                    { name: 'status', width: 40, align: 'center', sortable: false,
                    	cellattr:function (rowId, val, rawObject, cm) {
                	    	if(val == '<spring:message code="message.button.stop"/>'){//停用
                	    		return 'style="color:red"';
                	    	}
                        },
                        formatter : function(val, opts, rowdata) {
                            var strSta = "";
                            if(rowdata.status == 1){
                                strSta += "<spring:message code="message.button.start"/>";//启用
                            }else if(rowdata.status == 2){
                                strSta += "<spring:message code="message.button.stop"/>";//停用
                            }else if(val==3){
                            	 strSta += "<spring:message code="message.button.combineSpacing"/>";//合并
                            }
                            return strSta;
                        }
                    }
                    
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: true, 
                viewrecords: true,
                caption: "<spring:message code="message.list.drugqualityspecStdlist"/>",//品规列表
                gridComplete:function(){
                	//序号列宽度自适应（参数为jqgridID）
                    autoRNWidth("gridlist");
                	//数据只有一条时默认选中（参数为jqgridID）
                    selectByOneData("gridlist");
                },
                jsonReader: {
                    id: "qualitySpecId"
                }
            });
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $("#area2").HNSelect({
                url: "${ctx}/selectController/getArea.html", 
                data: { ID: '330000' },
                defaultText: "<option value=''><spring:message code="message.select.option"/></option>",//请选择
                defaultselect: "",
                func: function () {
                    $("#area3").HNSelect({
                        parent_selector: "#area2", 
                        url: "${ctx}/selectController/getArea.html", 
                        dataid: "ID", 
                        defaultText: "<option value=''><spring:message code="message.select.option"/></option>",//请选择
                        defaultselect: ""
                    });
                }
            });
            $("#hospClassify").HNSelect({
                url: "${ctx}/selectController/getArchiveType.html", 
                data: { classifyCode: "113" },
                defaultText: "<option value=''><spring:message code="message.select.option"/></option>",//请选择
                defaultselect: "",
            });

            $(window).trigger("resize");
            
        });
        
        
        
        
        //剂型  弹窗
        function dicForm() {
             var url = "${ctx}/stdDrugQualitySpec/toStdDrugQualitySpecDrugForm.html";
            $.HN.dialog.open({
                "id": "dicForm",
                "title": "<spring:message code="message.listForm.jiXing"/>", //剂型
                "url": url, 
                "data": {}, 
                "width": 800, 
                "height": 510, 
                "closefunc":function(params) {
                    if (params) {
                    	$("#form").val(params.form);
                        $("#formCode").val(params.formCode);
                        $("#formName").val(params.formName);
                    }
                }
            }); 
        }
        
        
        //规格 弹窗
        function dicSpec() {
        	 var url = "${ctx}/stdDrugQualitySpec/toStdDrugQualitySpecDrugSpec.html";
             $.HN.dialog.open({
                 "id": "dicSpec", 
                 "title": "<spring:message code="message.listForm.guiGe"/>",  //规格
                 "url": url, 
                 "data": {}, 
                 "width": 800, 
                 "height": 510, 
                 "closefunc":function(params) {
                     if (params) {
                         $("#spec").val(params.spec);
                         $("#specCode").val(params.specCode);
                         $("#specName").val(params.specName);
                     }
                 }
             }); 
        }
        
        
        
        
        function exportExcel(){
     		$.HN.message.confirm('<spring:message code="message.lable.OKExport"/>&nbsp;<spring:message code="message.lable.drugqualityxls"/>&nbsp;<spring:message code="message.lable.ma"/>', '', '').on(function (e) {
 	               if (e) {
 	            		  $("#exportExcel").submit();
 			
 	               }
          	 }); 
        }
        
    </script>
</body>
</html>